#pragma once

class CParticleFlyweight;

class CParticle
{

private:
	float	m_fCurrLife;
	float	m_fTotalLife;
	float	m_fColA;
	float	m_fColR;
	float	m_fColG;
	float	m_fColB;
	float	m_fVelX;
	float	m_fVelY;
	float	m_fPosX;
	float	m_fPosY;
	float	m_fScaleX;
	float	m_fScaleY;
	float	m_fRotation;
	float	m_fGravX;
	float	m_fGravY;
	bool	m_bIsDead;


	float m_fCPSColA;
	float m_fCPSColR;
	float m_fCPSColG;
	float m_fCPSColB;
	float m_fCPSVelX;
	float m_fCPSVelY;
	float m_fCPSScaleX;
	float m_fCPSScaleY;
	float m_fCPSRot;
	

	CParticleFlyweight* m_pFlyweight;


	void CalcChangePerSecond();


public:
	CParticle(void);
	CParticle(float totalLife, float posX, float posY, CParticleFlyweight* flyweight);
	~CParticle(void);

	void Update(float fElapsedTime);
	void Render();
	void InitializeParticle(float totalLife, float posX, float posY, CParticleFlyweight* flyweight);


	float	CurrLife(void)	{return m_fCurrLife; }
	float	TotalLife(void)	{return	m_fTotalLife;}
	float	ColorA(void)		{return	m_fColA;	 }
	float	ColorR(void)		{return	m_fColR;	 }
	float	ColorG(void)		{return	m_fColG;	 }
	float	ColorB(void)		{return	m_fColB;	 }
	float	VelX(void)		{return	m_fVelX;	 }
	float	VelY(void)		{return	m_fVelY;	 }
	float	PosX(void)		{return	m_fPosX;	 }
	float	PosY(void)		{return	m_fPosY;	 }
	float ScaleY() const { return m_fScaleY; }
	void ScaleY(float val) { m_fScaleY = val; }
	float ScaleX() const { return m_fScaleX; }
	void ScaleX(float val) { m_fScaleX = val; }
	float Rotation() const { return m_fRotation; }
	void Rotation(float val) { m_fRotation = val; }

	bool	IsDead(void)		{return	m_bIsDead;		 }

	void CurrLife	(float	 val){m_fCurrLife	= val	;}
	void TotalLife	(float	 val){m_fTotalLife	= val	;}
	void ColorA		(float	 val){m_fColA 	= val	;}
	void ColorR		(float	 val){m_fColR 	= val	;}
	void ColorG		(float	 val){m_fColG 	= val	;}
	void ColorB		(float	 val){m_fColB	 = val	;}
	void VelX		(float	 val){m_fVelX 	= val	;}
	void VelY		(float	 val){m_fVelY 	= val	;}
	void PosX		(float	 val){m_fPosX 	= val	;}
	void PosY		(float	 val){m_fPosY 	= val	;}
	void IsDead		(bool	 val){m_bIsDead	 = val	;}

	CParticleFlyweight* Flyweight() const { return m_pFlyweight; }
	void Flyweight(CParticleFlyweight* val) { m_pFlyweight = val; }
};

